﻿using GadgetStore.Data;
using GadgetStore.Data.Models;
using GadgetStore.Web.Adapters.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GadgetStore.Web.Adapters
{
    public class AllViewAdapter : IAllView
    {
        public List<Gadget> GetPagedGadgets(int pageNum)
        {
            ApplicationDbContext Db = new ApplicationDbContext();
            List<Gadget> Gadgets = Db.Gadgets.Skip((pageNum - 1) * 8).Take(8).ToList();
            return Gadgets;
        }
    }
}